package Eyjafjalla.card.attack;

import Eyjafjalla.action.EyjafjallaAttackAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.DamageAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class Strike_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "Strike_Eyjafjalla";
    private static final CardStrings cardStrings;

    public Strike_Eyjafjalla(){
        super(true,ID, cardStrings.NAME,1,cardStrings.DESCRIPTION,CardType.ATTACK,CardRarity.BASIC,CardTarget.ENEMY);
        this.tags.add(CardTags.STARTER_STRIKE);
        this.tags.add(CardTags.STRIKE);
        this.baseDamage = 6;
        this.damage =6;
        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
    }

    @Override
    public AbstractCard makeCopy() {
        return new Strike_Eyjafjalla();
    }

    @Override
    public void calculateCardDamage(AbstractMonster mo) {
        int trueD = baseDamage;
        if(isFire()){
            baseDamage+=2;
        }
        super.calculateCardDamage(mo);
        baseDamage = trueD;
        isDamageModified = baseDamage!=damage;
    }

    @Override
    public void applyPowers() {
        int trueD = baseDamage;
        if(isFire()){
            baseDamage+=2;
        }
        super.applyPowers();
        baseDamage = trueD;
        isDamageModified = baseDamage!=damage;
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new EyjafjallaAttackAction());
        addToBot(new DamageAction(m,new DamageInfo(p,this.damage,this.damageTypeForTurn), AbstractGameAction.AttackEffect.SLASH_HORIZONTAL));
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeDamage(3);
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}
